﻿@model NetSurveillance.WebApp.DataServices.Models.VirusEmbedRule

@{
    Layout = "~/Views/Shared/_SimpleLayout.cshtml";
    ViewBag.Title = "木马植入规则";
}
@section css{
    <style type="text/css">
        body {
            background-color: #ebebeb;
        }
        h3 {
            font-size: 1.8em;
            text-align: center;
        }
        fieldset,.inline-form {
            margin: 10px auto;
            width: 400px;
        }
        fieldset table {
            width: 100%;
            border-spacing:0;
            border-collapse:collapse;
            margin: 10px 0 0 0;
        }
        fieldset div.tip {
            margin-top: 10px;
        }
        .inline-form {
            margin-top: 30px;
        }
        .editor-entry .editor-label {
            width: 50px;
        }
    </style>
}
@section javascript
{
    <script type="text/javascript">
        $(function() {
            $('#btnBack').click(function() {
                window.location.href = '@Url.Action("Index")';
            });
        });
    </script>
}
@using (Html.BeginForm())
{
    <h3>@ViewBag.Title</h3>
    @Html.ValidationSummary()
    <div class="inline-form">
        <div class="editor-entry">
            <div class="editor-label">
                @Html.LabelFor(m => m.RuleName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.RuleName)
                @Html.ValidationMessageFor(m => m.RuleName)
            </div>
        </div>
    </div>
    <fieldset>
        <legend>网页替换</legend>
        <table>
            <tbody>
                <tr>
                    <td></td>
                    <td>源网址</td>
                    <td>目标网址</td>
                </tr>
                <tr>
                    <td>
                        @Html.CheckBoxFor(m => m.IsRedirectPage)
                    </td>
                    <td>
                        <label>http://</label>
                        @Html.TextBoxFor(m => m.OriginPage)
                    </td>
                    <td>
                        <label>http://</label>
                        @Html.TextBoxFor(m => m.TargetPage)
                    </td>
                </tr>
            </tbody>
        </table>
    </fieldset>
    <fieldset>
        <legend>文件替换</legend>
        <table>
            <tbody>
                <tr>
                    <td></td>
                    <td>下载源文件名</td>
                    <td>目标文件</td>
                </tr>
                <tr>
                    <td>
                        @Html.CheckBoxFor(m => m.IsRedirectFile)
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.OriginFileName)
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.TargetFileName)
                    </td>
                </tr>
            </tbody>
        </table>
    </fieldset>
    <fieldset>
        <legend>停止植入条件</legend>
        <div class="tip">
            <p>木马植入成功后，将自动访问以下网址，此时将停止网页替换或文件替换。</p>
            <p>即左边打勾无效。</p>
        </div>
        <table>
            <tbody>
                <tr>
                    <td>
                        @Html.CheckBoxFor(m => m.IsRedirectAfterInstall)
                    </td>
                    <td>
                        <label>http://</label>
                        @Html.TextBoxFor(m => m.RedirectUrlAfterInstall)
                    </td>
                </tr>
            </tbody>
        </table>
    </fieldset>
    <div class="buttonsContain controlBottom">
        <div class="rightContain">
            <input type="submit" id="btnSubmit" class="commonButton" value="@Resources.Resource.Button_Save"/>
            <input type="button" id="btnBack" class="commonButton" value="@Resources.Resource.Button_Exit"/>
        </div>
    </div>
    @Html.HiddenFor(m => m.Id)
}